using System;
using System.Drawing;
using System.Windows.Forms;
using System.Collections;
using System.Collections.Generic;

namespace Nate.GUI.Canvas.Component
{
    public class MouseZoom : IComponent
    {
        public MouseZoom(Base canvas)
        {
            _canvas = canvas;
        }

        public void InitializeComponent()
        {
            _canvas.MouseWheel += new MouseEventHandler(_MouseWheel);
        }

        public void Tick()
        {
        }
        
        private void _MouseWheel(object sender, MouseEventArgs e)
        {
            if (e.Delta > _min_delta)
            {
                _canvas.ZoomIn();
            }
            else if (e.Delta < _min_delta)
            {
                _canvas.ZoomOut();
            }
        }

        private Base _canvas;
        private const float _min_delta = float.Epsilon;
    }
}